表单提交问题<form method="post" action=

来源:百度知道 编辑:UC知道 时间:2024/06/05 18:28:07
<?php
$mch_price = $_post["key"];
?>
<form method="post" action="/so.php?wd=<?php echo ($mch_price);?>">
<input type="text" name="key" style="width:185px;height:18px;color:#999999;font-size:14px" value="" onClick="this.value=''">
<input type="submit" value="搜索" style="height:25px" class="put">
</form>
我想点击搜索按钮的时候打开的网址中问号后面有带有搜索关键词,现在的问题是地址里面无法获取搜索关键词,因为顺序的问题,谁有办法解决这个问题?我是新手,解决加分

<script type="text/javascript">
function so(){
var key=document.getElementById("key").value;
if (key==""){
alert("请输入您要搜索的关键词!");
return false;
}else{
document.search.action="/so.php?wd="+key+"";
return true;
}
}
</script>
<form name="search" id="search" method="post" action="" onsubmit="return so();">
<input type="text" name="key" id="key" style="width:185px;height:18px;color:#999999;font-size:14px" value="" onClick="this.value=''">
<input type="submit" value="搜索" style="height:25px" class="put">
</form>

$mch_price = $_GET["key"];

<form method="post" action="/so.php?wd=<?=$mch_price?>">

&